package uz.rt.utils;

/**
 * Interface defines the methods for a class that stores items internally in an array form.
 *
 * @param <T> DataType
 */
public interface Itemizable<U, T>
{
    /**
     * Add an item to a class
     *
     * @param item Item to be added
     */
    public void add(final T item);

    /**
     * Change the value of an item at index idx in the class
     *
     * @param idx  Index of the item that needs to be changed
     * @param item The item which replaces the item
     */
    public void edit(final U idx, final T item);

    /**
     * Remove an item from the class based on the index
     *
     * @param idx Index of the item that needs to be removed
     */
    public void removeByKey(final U idx);

    /**
     * Remove an item from the class
     *
     * @param item Item that needs to be removed
     */
    public void removeValue(final T item);

    /**
     * Returns the size of the internal array
     * @return The number of element stored in the class
     */
    public int size();
}
